fw = open('05.txt', mode='a')
lines = ['name1\n', 'name2\n', 'name3\n']
fw.writelines(lines)
fw.close()

